package com.wlh.animation.demo;

import com.wlh.animation.view.MaxItemListView;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.ArrayAdapter;

/**
 * Created by weilh on 2017/7/3.
 */

public class MaxItemListViewAct extends AppCompatActivity{

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MaxItemListView listView = new MaxItemListView(this);
        listView.setLayoutParams(new AbsListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT));
        listView.setMaxItemCount(3);
        listView.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1,
                new String[]{"a", "b", "c", "d", "e"}));

        setContentView(listView);
    }
}
